package com.xgj.entity;

import java.util.Objects;

public class Picture {
    private Long id; // 主键
    private String large;
    private String medium;
    private String thumbnail;

    // 构造方法
    public Picture() {}

    public Picture(String large, String medium, String thumbnail) {
        this.large = large;
        this.medium = medium;
        this.thumbnail = thumbnail;
    }

    // getter/setter
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLarge() {
        return large;
    }

    public void setLarge(String large) {
        this.large = large;
    }

    public String getMedium() {
        return medium;
    }

    public void setMedium(String medium) {
        this.medium = medium;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    // toString
    @Override
    public String toString() {
        return "Picture{" +
                "id=" + id +
                ", large='" + large + '\'' +
                ", medium='" + medium + '\'' +
                ", thumbnail='" + thumbnail + '\'' +
                '}';
    }

    // equals 和 hashCode
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Picture picture = (Picture) o;
        return Objects.equals(id, picture.id) &&
                Objects.equals(large, picture.large) &&
                Objects.equals(medium, picture.medium) &&
                Objects.equals(thumbnail, picture.thumbnail);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, large, medium, thumbnail);
    }
}
